package com.example.controller.web;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.common.Result;
import com.example.dto.ArticlePageDTO;
import com.example.service.ArticleService;
import com.example.vo.ArticlePageVO;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/index/article")
public class IndexArticleController {
    @Resource
    private ArticleService articleService;

    @PostMapping("/list")
    public Result<IPage<ArticlePageVO>> list(@RequestBody ArticlePageDTO articlePageDTO) {
        IPage<ArticlePageVO> vo = articleService.getPage(articlePageDTO);
        return Result.success(vo);
    }
}